From c32cff27bab6b78df0ea846bc7ddae3090f3d88a Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Sun, 1 Jul 2007 22:10:38 +0100 Subject: [PATCH] xend: Pass information to user when failing migrate due to PCI dev. When failing a migration / save due to the domain owning a PCI device make sure that we tell the user what went wrong! Signed-off-by: Mark Williamson --- tools/python/xen/xend/XendCheckpoint.py | 2 ++ tools/python/xen/xend/XendDomain.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/python/xen/xend/XendCheckpoint.py b/tools/python/xen/xend/XendCheckpoint.py index 2cfc06a2db..1aa7d7f69d 100644 --- a/tools/python/xen/xend/XendCheckpoint.py +++ b/tools/python/xen/xend/XendCheckpoint.py @@ -148,6 +148,8 @@ def save(fd, dominfo, network, live, dst, checkpoint=False): except: log.exception("Failed to reset the migrating domain's name") + raise exn + def restore(xd, fd, dominfo = None, paused = False): signature = read_exact(fd, len(SIGNATURE), diff --git a/tools/python/xen/xend/XendDomain.py b/tools/python/xen/xend/XendDomain.py index 4d082a5ac9..bca5830185 100644 --- a/tools/python/xen/xend/XendDomain.py +++ b/tools/python/xen/xend/XendDomain.py @@ -1262,8 +1262,10 @@ class XendDomain: try: XendCheckpoint.save(fd, dominfo, False, False, dst, checkpoint=checkpoint) - finally: + except Exception, e: os.close(fd) + raise e + os.close(fd) except OSError, ex: raise XendError("can't write guest state file %s: %s" % (dst, ex[1])) -- 2.30.2